package cn.livingCloud.dto;

import cn.livingCloud.entity.core.ReportRule;
import cn.livingCloud.utils.DateUtils;
import org.apache.commons.lang.StringUtils;

/**
 * Created by DingJie on 2016/6/27.
 */
public class ReportRuleDto {
    protected String createDateTime;
    protected Boolean archive;
    private String uuid;
    private String name;
    //sql
    private String sql;
    //解析内容
    private String content;
    private String deptUuid;
    private DeptDto deptDto;

    public ReportRuleDto() {
    }

    public ReportRuleDto(ReportRule item) {
        this.content = item.getContent();
        this.name = item.getName();
        this.archive = item.getArchive();
        this.uuid = item.getUuid();
        this.sql = item.getSql();
        this.createDateTime = DateUtils.toDateText(item.getCreateDateTime()
                , DateUtils.DEFAULT_DATE_TIME_FORMAT);
        this.deptUuid = item.getDeptUuid();
        if (StringUtils.isNotEmpty(item.getDeptUuid())) {
            this.deptDto = new DeptDto(item.getDept());
        }
    }

    public String getCreateDateTime() {
        return createDateTime;
    }

    public void setCreateDateTime(String createDateTime) {
        this.createDateTime = createDateTime;
    }

    public Boolean getArchive() {
        return archive;
    }

    public void setArchive(Boolean archive) {
        this.archive = archive;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getDeptUuid() {
        return deptUuid;
    }

    public void setDeptUuid(String deptUuid) {
        this.deptUuid = deptUuid;
    }

    public DeptDto getDeptDto() {
        return deptDto;
    }

    public void setDeptDto(DeptDto deptDto) {
        this.deptDto = deptDto;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
